package top.kaoshanji.p1ch04b;

import java.util.Locale;

/**
 * author kaoshanji
 * ^_^
 * create time 2025/1/16 19:08
 */
public class LocaleHolder {

    private static final InheritableThreadLocal<Locale> holder = new InheritableThreadLocal<Locale>() {

        @Override
        protected Locale initialValue() {
            return Locale.getDefault(Locale.Category.DISPLAY);
        }

    };

    public static Locale get() {
        return holder.get();
    }

    public static void set(Locale locale) {
        holder.set(locale);
    }

}
